// 新建 aiService.ts 或替换原有实现
import { chatInterface } from '../api/jwh/api';

export const aiService = {
  chat: async (messages: any) => {
    try {
      const response = await chatInterface(messages);
      return {
        code: 200,
        data: response.data  // 直接返回后端原始响应
      };
    } catch (error) {
      return {
        code: 500,
        error: '请求失败'
      };
    }
  }
};